﻿/*
 * License: Copyright (c) Huawei Technologies Co., Ltd. 2012-2019. All rights reserved.
 * Description: 状态定义
 * Date: 2019-02-28
 * LastEditTime: 2019-09-24 15:59:53
 */
#ifndef HIAIENGINE_ALG_STATUS_H
#define HIAIENGINE_ALG_STATUS_H

#include "hiaiengine/status.h"

/*****************************************算法模块*****************************************/
#define MODID_ALG_MODEL_MANAGER 0x0201  // Model_nanager
#define MODID_ALG_ENGINE 0x0202         // HiAIEngine
#define MODID_ALG_DVPP 0x0203           // DVPP

enum {
    ALG_MODEL_MANAGER_DESC_FAIL_CODE = 0x201,
    ALG_MODEL_MANAGER_INIT_FAIL_CODE,
    ALG_MODEL_MANAGER_SET_LISTENER_FAIL_CODE,
    ALG_MODEL_MANAGER_CREATE_TENSOR_FAIL_CODE,
    ALG_MODEL_MANAGER_PROCESS_FAIL_CODE,
    ALG_ENGINE_POINTER_NULL_CODE,
    ALG_ENGINE_INPUT_IMAGE_FORMAT_WRONG_CODE,
    ALG_ENGINE_INPUT_PARA_WRONG_CODE,
    ALG_ENGINE_BATCH_SIZE_WRONG_CODE,
    ALG_ENGINE_INPUT_DATA_NOT_READY_CODE,
    ALG_ENGINE_INIT_FAIL_CODE,
    ALG_ENGINE_PROCESS_FAIL_CODE,
    ALG_DVPP_RECT_SIZE_WRONG_CODE,
    ALG_DVPP_RESIZE_PARA_WRONG_CODE,
    ALG_DVPP_CROP_PARA_WRONG_CODE,
    ALG_DVPP_CTL_PROCESS_FAIL_CODE,
    ALG_DVPP_PIDVPPAPI_NULL_CODE,
    ALG_DVPP_CREATE_DVPP_FAIL_CODE,
    ALG_DVPP_DST_DATA_NULL_CODE
};
/********************* MODEL_MANAGER ****************************/
// 创建MODEL_MANAGER error级别错误
HIAI_DEF_ERROR_CODE(
    MODID_ALG_MODEL_MANAGER, HIAI_ERROR, ALG_MODEL_MANAGER_DESC_FAIL, "model manager getModelInfo model_desc fail");
HIAI_DEF_ERROR_CODE(MODID_ALG_MODEL_MANAGER, HIAI_ERROR, ALG_MODEL_MANAGER_INIT_FAIL, "model manager init fail");
HIAI_DEF_ERROR_CODE(
    MODID_ALG_MODEL_MANAGER, HIAI_ERROR, ALG_MODEL_MANAGER_SET_LISTENER_FAIL, "model manager set listener fail");

HIAI_DEF_ERROR_CODE(
    MODID_ALG_MODEL_MANAGER, HIAI_ERROR, ALG_MODEL_MANAGER_CREATE_TENSOR_FAIL, "model manager create tensor fail");
HIAI_DEF_ERROR_CODE(MODID_ALG_MODEL_MANAGER, HIAI_ERROR, ALG_MODEL_MANAGER_PROCESS_FAIL, "model manager process fail");
/*********************ENGINE****************************/
// 创建ENGINE error级别错误
HIAI_DEF_ERROR_CODE(MODID_ALG_ENGINE, HIAI_ERROR, ALG_ENGINE_POINTER_NULL, "null pointer");
HIAI_DEF_ERROR_CODE(
    MODID_ALG_ENGINE, HIAI_ERROR, ALG_ENGINE_INPUT_IMAGE_FORMAT_WRONG, "Engine input image format wrong");
HIAI_DEF_ERROR_CODE(MODID_ALG_ENGINE, HIAI_ERROR, ALG_ENGINE_INPUT_PARA_WRONG, "Engine input data wrong");
HIAI_DEF_ERROR_CODE(MODID_ALG_ENGINE, HIAI_ERROR, ALG_ENGINE_BATCH_SIZE_WRONG, "Engine input batch size wrong");
HIAI_DEF_ERROR_CODE(MODID_ALG_ENGINE, HIAI_ERROR, ALG_ENGINE_INPUT_DATA_NOT_READY, "Engine input data not ready");
HIAI_DEF_ERROR_CODE(MODID_ALG_ENGINE, HIAI_ERROR, ALG_ENGINE_INIT_FAIL, "Engine init fail");
HIAI_DEF_ERROR_CODE(MODID_ALG_ENGINE, HIAI_ERROR, ALG_ENGINE_PROCESS_FAIL, "Engine process fail");
/*********************DVPP****************************/
// 创建DVPP error级别错误
HIAI_DEF_ERROR_CODE(MODID_ALG_DVPP, HIAI_ERROR, ALG_DVPP_RECT_SIZE_WRONG, "DVPP input rect size wrong");
HIAI_DEF_ERROR_CODE(MODID_ALG_DVPP, HIAI_ERROR, ALG_DVPP_RESIZE_PARA_WRONG, "DVPP resize para wrong");
HIAI_DEF_ERROR_CODE(MODID_ALG_DVPP, HIAI_ERROR, ALG_DVPP_CROP_PARA_WRONG, "DVPP crop para wrong");
HIAI_DEF_ERROR_CODE(MODID_ALG_DVPP, HIAI_ERROR, ALG_DVPP_CTL_PROCESS_FAIL, "DVPP call dvppctl process fail");
HIAI_DEF_ERROR_CODE(MODID_ALG_DVPP, HIAI_ERROR, ALG_DVPP_PIDVPPAPI_NULL, "DVPP pidvppapi is null");
HIAI_DEF_ERROR_CODE(MODID_ALG_DVPP, HIAI_ERROR, ALG_DVPP_CREATE_DVPP_FAIL, "Create DVPP fail");
HIAI_DEF_ERROR_CODE(MODID_ALG_DVPP, HIAI_ERROR, ALG_DVPP_DST_DATA_NULL, "Dst data is null");
#endif  // HIAIENGINE_ALG_STATUS_H
